import json

test_case = {}

with open("dbg.json", "r") as fp:
    test_case = json.loads(fp.read())


def parse_arg(arg):
    # print(arg['type'])
    st = ""
    if arg['type'] == "hex":
        return "\tptr\n"
    elif arg['type'] == "struct":
        items = arg['items']
        for i in items:
            st += parse_arg(i)
        return st
    elif arg['type'] == "int":
        return "\tint\n"
    else:
        return "invalid"


arg_list = test_case['args']
for arg in arg_list:
    print(arg['type'])
    print(parse_arg(arg))
